package com.outsourcingmanagesystem.service.impl;

import com.outsourcingmanagesystem.entity.User;
import com.outsourcingmanagesystem.entity.WorkHour;
import com.outsourcingmanagesystem.mapper.UserMapper;
import com.outsourcingmanagesystem.mapper.WorkHourMapper;
import com.outsourcingmanagesystem.service.LeaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.sound.midi.Soundbank;

@Service
public class LeaderServiceImpl implements LeaderService {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private WorkHourMapper workHourMapper;

    @Override
    public void approveOnDuty(Integer userId) {
        //todo 查询出来应该是一个集合
        WorkHour workHour = workHourMapper.selectById(userId);
        workHour.setStatus((byte) 1);
        workHourMapper.updateById(workHour);
    }
}
